package com.cheng.service.impl;

import com.cheng.entity.Tieba;
import com.cheng.mapper.TiebaMapper;
import com.cheng.service.TiebaService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Cheng
 * @since 2019-07-18
 */
@Service
public class TiebaServiceImpl extends ServiceImpl<TiebaMapper, Tieba> implements TiebaService<Tieba> {

    public static void main(String[] args) {
        Map<Integer, String> result = new HashMap<>();
        result.put(1, "one");
        result.put(2, "two");
        result.put(3, "three");
        result.forEach((integer, string) -> {
            System.out.println("key值为" + integer + "value值为" + string);
        });
        result.getOrDefault(1, "12");
//        result.replaceAll();
        Stream<String> results = Stream.of("你好", "你昨天去干什么");
        List<String> collect = results.collect(Collectors.toCollection(ArrayList::new));
        result.merge(1, "2", (v1, v2) -> v1 + v2);
        collect.parallelStream().map((x) -> ObjectUtils.toString("ss")).collect(Collectors.toList());
    }


}
